/**
 * 
 */
package com.dp.behav.command;

/**
 * This is to describe command pattern.
 * 
 * Command pattern encapsulates a request as an object , thereby letting you
 * parameterize other objects with different requests and support undoable
 * operations. Example Macros
 * 
 * @author Sunaina.Sharma
 * 
 */
public class CommandEx {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		LightOnCommand kitchenLightOn = new LightOnCommand();
		LightOffCommand kitchenLightOff = new LightOffCommand();
		RemoteControl remoteControl = new RemoteControl();
		remoteControl.setCommand(0, kitchenLightOn, kitchenLightOff);
		remoteControl.onButtonWasPushed(0);
		remoteControl.offButtonWasPushed(0);
	}
}
